Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement pre-approval flow in btc-staker #44

Merged
merged 7 commits into from
Oct 9, 2024

Conversation

KonradStaniec
Copy link
Collaborator

@KonradStaniec KonradStaniec commented Oct 9, 2024

Implements pre-approval flow in btc staker.

There is new config option CheckActiveInterval (cc: @filippos47 )

In general this is basic support which assumes there is vigiliante in the network that wil provide the proof on inclusion at some point in time.

At this time two flows are supported, to use pre-approval flow staker must provide flag:
--send-to-babylon-first=true

At least two follow up tasks (which is not blocking for devnet2):

Copy link
Member

@Lazar955 Lazar955 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! Nice work

@@ -126,6 +126,10 @@ var stakeCmd = cli.Command{
Usage: "Staking time in BTC blocks",
Required: true,
},
cli.BoolFlag{
Name: helpers.SendToBabylonFirstFlag,
Usage: "Wheter staking transaction should be first to Babylon or BTC",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Usage: "Wheter staking transaction should be first to Babylon or BTC",
Usage: "Whether staking transaction should be first to Babylon or BTC",

@@ -1451,7 +1535,7 @@ func TestStakingUnbonding(t *testing.T) {
tm.waitForStakingTxState(t, txHash, proto.TransactionState_SPENT_ON_BTC)
}

func TestUnbondingRestartWaitingForSignatures(t *testing.T) {
func AestUnbondingRestartWaitingForSignatures(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func AestUnbondingRestartWaitingForSignatures(t *testing.T) {
func TestUnbondingRestartWaitingForSignatures(t *testing.T) {

// - delegation is on babylon
// - delegation has received enough covenant signatures
func (app *StakerApp) activateVerifiedDelegation(
stakerAddress btcutil.Address,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stakerAddress seems to be unused

@@ -133,7 +138,7 @@ func (app *StakerApp) buildDelegation(
stakerAddress btcutil.Address,
storedTx *stakerdb.StoredTransaction) (*cl.DelegationData, error) {

stakingTxInclusionProof := app.mustBuildInclusionProof(req)
// stakingTxInclusionProof := app.mustBuildInclusionProof(req)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover?

Copy link
Contributor

@RafilxTenfen RafilxTenfen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@KonradStaniec KonradStaniec merged commit 4b64872 into main Oct 9, 2024
8 checks passed
@KonradStaniec KonradStaniec deleted the konradstaniec/adapt-to-pre-approval-flow branch October 9, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants